<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html:html>
<head>	
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/sampleForm.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/me.css" />	
	<title>บันทึกใบขอเบิกใช้สินค้า, วัตถุดิบ (BCStkIssue2, BCStkIssueSub2)</title>
	<script type='text/javascript' src='/ittl/dwr/interface/BCProjectService.js'></script>
  	<script type='text/javascript' src='/ittl/dwr/interface/ItemLocationService.js'></script>
  	<script type='text/javascript' src='/ittl/dwr/engine.js'></script>
  	<script type='text/javascript' src='/ittl/dwr/util.js'></script>

	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/lib/jquery.js' ></script>
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/lib/jquery.bgiframe.min.js' ></script>
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/lib/jquery.ajaxQueue.js' ></script>
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/lib/thickbox-compressed.js' ></script>
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/lib/jquery.autocomplete.js' ></script>
	
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/data/localdata.js' ></script>
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/data/localdata2.js' ></script>
	<script type='text/javascript' src='<%= request.getContextPath() %>/css/autocomplete/data/localdata3.js' ></script>
	
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/autocomplete/css/mainOLD.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/autocomplete/css/jquery.autocomplete.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/autocomplete/css/thickbox.css" />
 
 	<script type="text/javascript" src="<%= request.getContextPath() %>/stockRequest/jquery.validate.js" ></script>
 	<script type="text/javascript" src="<%= request.getContextPath() %>/stockRequest/jquery-1.4.2.min1.js" ></script>

<script type="text/javascript">
$(function() {

	var i = $('input').size() + 1;
	//alert("i= "+i);
	var itemNum = 2;
	var suggestStr = "suggestCode";
	var rowItem = 5;
	$('a.add').click(function() {

		
		$('<p><input type="text" value="input ' + i + '" /></p>').animate({ opacity: "show" }, "slow").appendTo('#inputs');

//#####################
		var idStr =suggestStr+itemNum; 
		//alert("idStr = "+idStr);
 		if (itemNum==3) {
			$('<tr><td><input 	type="text" name="itemCode3" value="abc" size="15" onblur="getData(document.getElementById(\'suggestCode3\').value,3)" id="suggestCode3"></td><td><input 	type="text" name="itemName3" value="" maxlength="200" size="50" ><input	type="hidden" name="whCode3" value=""></td><td><select name="shelfCode3" id="shCode3"></select></td><td align="center"><LABEL id="unitName3" ></LABEL><input	type="hidden" name="unitCode3" value="" ></td><td><input	type="text"	name="qty3" value="" maxlength="5" size="5" ></td><td></td></tr>').animate({ opacity: "show" }, "slow").appendTo('#tbltr');
		}
		$('<p><input type="text" value="input ' + i + '" id="suggestCode5"/></p>').animate({ opacity: "show" }, "slow").appendTo('#items');
//#####################
		alert(document.getElementById("suggestCode5").value);
		//alert("itemNum= "+itemNum);
		
		itemNum++;
		i++;
	});

	$('a.remove').click(function() {	
//		if(i > 21) {
//			$('input:last').animate({opacity:"hide"}, "slow").remove();
//			i--;			
//		}
		if(rowItem>1) {
			var ItemData = document.getElementById("suggestCode"+rowItem).value+
							document.getElementById("itemName"+rowItem).value+
							document.getElementById("qty"+rowItem).value;						
			if (ItemData == "") {			
				$('#suggestCode'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#itemName'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#whCode'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#shCode'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#unitName'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#unitCode'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#qty'+rowItem).animate({opacity:"hide"}, "slow").remove();
				$('#qty'+rowItem+'-error').animate({opacity:"hide"}, "slow").remove();
				$('#suggestCode'+rowItem+'-error').animate({opacity:"hide"}, "slow").remove();
				rowItem--;
			}else {
				alert("ไม่สามารถลบได้!! \n\nเนื่องจากข้อมูลแถวที่   " +rowItem+ " ไม่เท่ากับค่าว่าง");
			}			
		}else {
			alert("ไม่สามารถลบได้!! \tกรุณาบันทึกรายการอย่างน้อย 1 ข้อมูล");
		}
	});
	
	$('a.reset').click(function() {	
		while(i > 21) {
			$('input:last').remove();
			i--;
		}
	});
	
});
</script>
<style type="text/css">
#form1 label.error {
	font-size: 1.0em;
	color: red;
}
</style> 	
<script language="JavaScript">

$(document).ready(function() {

	$("#form1").validate({
		
		rules: {
			projectName1: "required",
			itemCode1: "required",
			itemCode2: "required",
			itemCode3: "required",
			itemCode4: "required",
			itemCode5: "required",
			itemName1: "required",
			itemName2: "required",
			itemName3: "required",
			itemName4: "required",
			itemName5: "required",	
			shelfCode1: "required",
			shelfCode2: "required",
			shelfCode3: "required",
			shelfCode4: "required",
			shelfCode5: "required",		
			qty1: {
				required: 	true,
				number:		true
			},
			qty2: {
				required: 	true,
				number:		true
			},
			qty3: {
				required: 	true,
				number:		true
			},
			qty4: {
				required: 	true,
				number:		true
			},
			qty5: {
				required: 	true,
				number:		true
			}						
		},
		messages: {
			projectName1: "*",
			itemCode1: "*",
			itemCode2: "*",
			itemCode3: "*",
			itemCode4: "*",
			itemCode5: "*",
			itemName1: "*",
			itemName2: "*",
			itemName3: "*",
			itemName4: "*",
			itemName5: "*",
			shelfCode1: "*",
			shelfCode2: "*",
			shelfCode3: "*",
			shelfCode4: "*",
			shelfCode5: "*",						
			qty1: "*Number",
			qty2: "*Number",
			qty3: "*Number",
			qty4: "*Number",
			qty5: "*Number"	
		},
		submitHandler: function() {
			alert("submitted!22");
			form.submit();
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
			//alert("errorPlacement");			
			if ( element.is(":radio") ) {
				alert("radio");
				error.appendTo( element.parent().next().next() );
			}else if ( element.is(":checkbox") ) {
				alert("checkbox");
				error.appendTo ( element.next() );
			}else {
				/*alert(element("#itemCode1"));
				if(element.is("#itemCode1")) {
					error.appendTo( "#qty1-error" );
				}else {
					error.appendTo( element.parent().next() );	
				}*/
				//error.insertAfter('#qty1-error');
				error.appendTo( element.parent().next() );
			}
		}		
	});
		
	$("#suggest1").focus().autocomplete(cities);
	
	$("#suggestProject").autocomplete(projects, {
		matchContains: "word",
		minChars: 0
	});
	
	$("#suggestCode1").autocomplete(codes, {
		matchContains: "word",
		minChars: 0
	});
	
	$("#suggestCode2").autocomplete(codes, {
		matchContains: "word",
		minChars: 0
	});
	
	$("#suggestCode3").autocomplete(codes, {
		matchContains: "word",
		minChars: 0
	});
	$("#suggestCode4").autocomplete(codes, {
		matchContains: "word",
		minChars: 0
	});
	$("#suggestCode5").autocomplete(codes, {
		matchContains: "word",
		minChars: 0
	});
	
	$("#suggest11").autocomplete(cities, {
		matchContains: true,
		minChars: 0
	});

    $("#itemName5").autocomplete(cities, { scroll: true } );

	$("#suggest4").autocomplete(emails, {
		minChars: 0,
		width: 3100,
		matchContains: true,
		autoFill: false,
		formatItem: function(row, i, max) {
			return i + "/" + max + ": \"" + row.name + "\" [" + row.to + "]";
		},
		formatMatch: function(row, i, max) {
			return row.name + " " + row.to;
		},
		formatResult: function(row) {
			return row.to;
		}
	});
/*
	$("#suggest5").autocomplete(items, {
		minChars: 0,		
		matchContains: true,
		autoFill: false,
		formatItem: function(row, i, max) {
			return row.code + ":  [" + row.name + "]";
		},
		formatMatch: function(row, i, max) {
			return row.name + " " + row.code;
		},
		formatResult: function(row) {
			return row.code;
		}
	});
*/	
});

</script>  

<!--  ส่วนที่ 2 -->
<script language="JavaScript">
var inputNo;
var itemName = "";
var code;
var itemName;
var whCode;
var shelfCode;
var shelfName;

function getAlert() {
	alert("before Test !!");
	alert("after Test !!");
	alert(document.getElementById("suggestCode1").value);
	alert(document.getElementByName("itemCode1").value);
		
	alert(document.form1.itemCode1.value);
	alert(document.form1.suggestCode1.value);

	for(var i=0; i< document.form1.elements.length; i++) {
		alert(document.form1.elements[i].value)
	}	
}

function getAlert2() {
	alert("before Test !!");	
	alert("aid= "+document.getElementById("aid").value);	
	alert("anm= "+document.getElementsByName("anm").value);
	
	alert(document.getElementById("suggestCode1").value);
	alert(document.getElementsByName("itemCode1").value);
		
	alert(document.form1.itemCode1.value);
	alert(document.form1.suggestCode1.value);

	for(var i=0; i< document.form1.elements.length; i++) {
		alert(document.form1.elements[i].value)
	}	
}

function getData(var1,x) {
	//alert("bcitem");
	inputNo = x;
	ItemLocationService.getData( var1, loadinfo );
	  
}

<!--  ส่วนที่ 3 -->
function loadinfo(data)
{
	code 	  = data.code;
	itemName  = data.name1;
	whCode 	  = data.whCode;
	shelfCode = data.shelfCode;
	shelfName = data.shelfName;
	unitCode = data.unitCode;
	unitName = data.unitName;
	
	switch(inputNo) {
	case 1:	dwr.util.setValue("itemCode1", code);
			dwr.util.setValue("itemName1", itemName);
			dwr.util.setValue("whCode1", whCode);
			dwr.util.setValue("whCode11", whCode);
			dwr.util.setValue("unitCode1", unitCode);
			dwr.util.setValue("unitName1", unitName);
			redirectN(0, document.getElementById('shCode1'));					
			break;
	case 2:	dwr.util.setValue("itemCode2", code);
			dwr.util.setValue("itemName2", itemName);
			dwr.util.setValue("whCode2", whCode);			
			dwr.util.setValue("unitCode2", unitCode);
			dwr.util.setValue("unitName2", unitName);
			redirectN(0, document.getElementById('shCode2'));			
			break;
	case 3:	dwr.util.setValue("itemCode3", code);
			dwr.util.setValue("itemName3", itemName);
			dwr.util.setValue("whCode3", whCode);			
			dwr.util.setValue("unitCode3", unitCode);
			dwr.util.setValue("unitName3", unitName);
			redirectN(0, document.getElementById('shCode3'));			
			break;
	case 4:	dwr.util.setValue("itemCode4", code);
			dwr.util.setValue("itemName4", itemName);
			dwr.util.setValue("whCode4", whCode);			
			dwr.util.setValue("unitCode4", unitCode);
			dwr.util.setValue("unitName4", unitName);
			redirectN(0, document.getElementById('shCode4'));			
			break;
	case 5:	dwr.util.setValue("itemCode5", code);
			dwr.util.setValue("itemName5", itemName);
			dwr.util.setValue("whCode5", whCode);			
			dwr.util.setValue("unitCode5", unitCode);
			dwr.util.setValue("unitName5", unitName);
			redirectN(0, document.getElementById('shCode5'));//ใช้ document.form1.shelfCode5 จะทำงานได้บน IE แต่ไม่ไได้บน FF			
			break;
	}
	//displayShelfName();
	

//	alert("shelfName.length ="+shelfName.length );
//	alert("shelfName[0] ="+shelfName[0] );

//	alert("shelfCode.length ="+shelfCode.length );
//	alert("shelfCode[0] ="+shelfCode[0] );	
}
function displayShelfName() {
//	alert("whCode = "+whCode );
//	alert("shelfName = "+shelfName );
}

function redirectN(x, tempN){
	
	var groupsN=5;//document.form1.shelfCode1.options.length
	var groupN=new Array(groupsN);
	for (i=0; i<groupsN; i++)
		groupN[i]=new Array();

	//var tempN=document.form1.shelfCode1;	
	//alert("tempN.options.length-1 = "+(tempN.options.length-1));
	for (m=tempN.options.length-1;m>=0;m--) {
		//alert(tempN.options[m]);
		tempN.options[m]=null;
	}
	
	if(shelfName != null) {
		for (i=0; i<shelfName.length; i++) {
			groupN[0][i]=new Option(shelfName[i], shelfCode[i]);
		}
					
		for (i=0;i<groupN[x].length;i++){
			text = groupN[x][i].value+":"+groupN[x][i].text;
			tempN.options[i]=new Option(text,groupN[x][i].value);
		}
		tempN.options[0].selected=true;
	}
}

</script>
<!--  ส่วนที่ 2 -->
<script language="JavaScript">

function getProject() {
	//alert("bcproject"+form1.projectCode.value); ใช้ใน ff ไม่ผ่าน
	//alert("document.getElementById('suggestProject').value ="+document.getElementById("suggestProject").value);	
	BCProjectService.getProject( document.getElementById("suggestProject").value, loadinfoProject );	  
}

<!--  ส่วนที่ 3 -->
function loadinfoProject(project)
{	
	//alert(project.name);
	//dwr.util.setValue("projectCode", project.name);
	dwr.util.setValue("projectName", project.name);	
		     
}
</script>	
<script type="text/javascript">
function alertValue() {
	alert(document.getElementById('htmlElementTest').value)
}
</script>

</head>
<body >
			
	<div style="background: #ffffff;">
	<p align="center" id="titleIssueType">ประเภทการเบิก : ${issue2form.issueName},${issue2form.departCode },${issue2form.issueType }</p>
	<!-- <p align="center">แผนก  : ${departCode }</p>  --><br></br>	
	
	<center><div style="border: 1px solid;   width:200px; background: #ffc080" >คุณกำลังแก้ใขข้อมูล</div></center>
		
	<html:form action="/StkReq.do?mode=update" styleId="form1"  >
	        
        <input type="hidden" name="departCode" value="${issue2form.departCode }" />
        <input type="hidden" name="issueType" value="${issue2form.issueType}" />
	<div id="userPw01">
	<fieldset>
		<legend><b>ข้อมูลใบขอเบิกใช้สินค้า, วัตถุดิบ</b></legend><br />
		   <center> 
		   <table border="0">
			<tr>
				<td width="130"><label> เลขที่เอกสาร </label></td>
				<td width="140"><input type="text" name="docNo" value="${issue2form.docNo}" readonly="readonly" id="docNo" ></td>
				<td></td>
				<td width="115"><label>เลขที่คำสั่งซื้อ </label></td>
				<td><input type="text" name="orderNo" maxlength="20" value="${issue2form.orderNo }" id="orderNo" size="25" ></td>
				<td> </td>				
			</tr>
 			<tr>
 				<td><label>เลขงบ(โครงการ)</label></td>
 				<td><input type="text" name="projectCode" value="${issue2form.projectCode }" onblur="getProject()" id="suggestProject" ></td>
 				<td></td> 				
 				<td colspan="2"><input type="text" name="projectName" value="" size="45" readonly="readonly" /> </td>
 				<td></td>	
 			</tr>
			<tr>
				<td width="130"><label>ฝ่ายผู้เบิก </label></td>
				<td width="140"><input type="text" name="departCode" value="${issue2form.departCode }" readonly="readonly" id="departCode" ></td>
				<td></td>
				<td width="115"><label>ฝ่ายชำระเงิน</label></td>
				<td><input type="text" name="iTTL_deptPay" maxlength="3" value="${issue2form.iTTL_deptPay }" id="suggestDeptPay" size="25" ></td>
				<td> </td>				
			</tr> 			
 			<tr>
 				<td><label>ผู้เบิก</label></td>
 				<td colspan="4"><input type="text" name="personCode" value="${issue2form.personCode}" readonly="readonly"></td>
 				<td></td>

 			</tr>
 			<tr>
 				<td><label>หมายเหตุ</label></td>
 				<td colspan="4"><input type="text" name="myDescription" value="${issue2form.myDescription }" maxlength="200" size="70"></td>
 				<td></td>	
 			</tr>
 			 			 			 				 							
		</table>
		</center>
     </fieldset></div>
    <div id="items"> 
     <fieldset>
     	<legend><b>รายการสินค้า, วัตถุดิบ</b></legend>
     	<a href="#" class="remove"><img src="<%=request.getContextPath() %>/images/remove.png" width="24" height="24" alt="Remove Row" /></a>
		<table border="0" >
			<thead>			
				<tr>
				  <th width="100" align="center">รหัสสินค้า</th>
				  <th width="10"></th>
				  <th width="270" align="center">ชื่อรายการ</th>
				  <th width="10"></th>				
				  <th width="80"  align="center">ที่เก็บ</th>
				  <th width="10"></th>
				  <th width="70"  align="center">หน่วยนับ</th>
				  <th width="10"></th>
				  <th width="60"  align="center">จำนวน</th>
				  <th></th>				
				</tr>
			</thead>
			<tbody>
				<tr>				
				  	<td><input 	type="text" name="itemCode1" value="${issue2form.itemCode1 }" size="12" 
				  				onblur="getData(document.getElementById('suggestCode1').value,1)" id="suggestCode1">			  		
				  	</td><td></td>
					<td><input 	type="text" name="itemName1" value="${issue2form.itemName1 }" maxlength="200" size="40" id="itemName1">					
						<input	type="hidden" name="whCode1" value="${issue2form.whCode1}" id="whCode1">
					</td><td></td>	
					<td><select name="shelfCode1" id="shCode1">
							<option value="${issue2form.shelfCode1 }">${issue2form.shelfCode1 }:${issue2form.shelfName1 }
						</select></td><td></td>
					<td align="center"><LABEL id="unitName1" >${issue2form.unitName1}</LABEL>					
						<input	type="hidden" name="unitCode1" value="${issue2form.unitCode1}" id="unitCode1">
					</td><td></td>
					<td><input	type="text"	name="qty1" value="${issue2form.qty1}" maxlength="5" size="5" id="qty1" ></td>
					<td></td>
				</tr>
				<tr>				
				  	<td><input 	type="text" name="itemCode2" value="${issue2form.itemCode2 }" size="12" 
				  				onblur="getData(document.getElementById('suggestCode2').value,2)" id="suggestCode2">
				  	</td><td></td>
					<td><input 	type="text" name="itemName2" value="${issue2form.itemName2 }" maxlength="200" size="40" id="itemName2">					
						<input	type="hidden" name="whCode2" value="${issue2form.whCode2}" id="whCode2">
					</td><td></td>				
					<td><select name="shelfCode2" id="shCode2">
							<option value="${issue2form.shelfCode2 }">${issue2form.shelfCode2 }:${issue2form.shelfName2 }
						</select></td><td></td>
					<td align="center"><LABEL id="unitName2" >${issue2form.unitName2}</LABEL>					
						<input	type="hidden" name="unitCode2" value="${issue2form.unitCode2}" id="unitCode2">
					</td><td></td>
					<td><input	type="text"	name="qty2" value="${issue2form.qty2}" maxlength="5" size="5" id="qty2" ></td>
					<td><label id="qty2-error"></label></td>
				</tr>
				<tr>				
				  	<td><input 	type="text" name="itemCode3" value="${issue2form.itemCode3 }" size="12" 
				  				onblur="getData(document.getElementById('suggestCode3').value,3)" id="suggestCode3">
				  	</td><td></td>
					<td><input 	type="text" name="itemName3" value="${issue2form.itemName3 }" maxlength="200" size="40" id="itemName3">					
						<input	type="hidden" name="whCode3" value="${issue2form.whCode3}" id="whCode3">
					</td><td></td>				
					<td><select name="shelfCode3" id="shCode3">
							<option value="${issue2form.shelfCode3 }">${issue2form.shelfCode3 }:${issue2form.shelfName3 }
						</select></td><td></td>
					<td align="center"><LABEL id="unitName3" >${issue2form.unitName3}</LABEL>					
						<input	type="hidden" name="unitCode3" value="${issue2form.unitCode3}" id="unitCode3">
					</td><td></td>
					<td><input	type="text"	name="qty3" value="${issue2form.qty3}" maxlength="5" size="5" id="qty3" ></td>
					<td><label id="qty3-error"></label></td>
				</tr>
				<tr>				
				  	<td><input 	type="text" name="itemCode4" value="${issue2form.itemCode4 }" size="12" 
				  				onblur="getData(document.getElementById('suggestCode4').value,4)" id="suggestCode4">
				  	</td><td></td>
					<td><input 	type="text" name="itemName4" value="${issue2form.itemName4 }" maxlength="200" size="40" id="itemName4">					
						<input	type="hidden" name="whCode4" value="${issue2form.whCode4}" id="whCode4">
					</td><td></td>				
					<td><select name="shelfCode4" id="shCode4">
							<option value="${issue2form.shelfCode4 }">${issue2form.shelfCode4 }:${issue2form.shelfName4 }
						</select></td><td></td>
					<td align="center"><LABEL id="unitName4" >${issue2form.unitName4}</LABEL>					
						<input	type="hidden" name="unitCode4" value="${issue2form.unitCode4}" id="unitCode4">
					</td><td></td>
					<td><input	type="text"	name="qty4" value="${issue2form.qty4}" maxlength="5" size="5" id="qty4" ></td>
					<td><label id="qty4-error"></label></td>
				</tr>
				<tr>				
				  	<td><input 	type="text" name="itemCode5" value="${issue2form.itemCode5 }" size="12" 
				  				onblur="getData(document.getElementById('suggestCode5').value,5)" id="suggestCode5">
				  	</td><td></td>
					<td><input 	type="text" name="itemName5" value="${issue2form.itemName5 }" maxlength="200" size="40" id="itemName5">					
						<input	type="hidden" name="whCode5" value="${issue2form.whCode5}" id="whCode5">
					</td><td></td>				
					<td><select name="shelfCode5" id="shCode5">
							<option value="${issue2form.shelfCode5 }">${issue2form.shelfCode5 }:${issue2form.shelfName5 }
						</select></td><td></td>
					<td align="center"><LABEL id="unitName5" >${issue2form.unitName5}</LABEL>					
						<input	type="hidden" name="unitCode5" value="${issue2form.unitCode5}" id="unitCode5">
					</td><td></td>
					<td><input	type="text"	name="qty5" value="${issue2form.qty5}" maxlength="5" size="5" id="qty5" ></td>
					<td><label id="qty5-error"></label></td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="9">หมายเหตุ : <font color="red">*</font> คือข้อมูลที่ต้องใส่</td>
				</tr>
			</tfoot>						
		</table>     	
     </fieldset>
 	</div>
 	
 	<table border="0" align="center" width="100%">
 		<tr>
 			<td align="center" ><html:submit  value="บันทึกการแก้ไขใบขอเบิก พ.1" onclick="return confirm('ยืนยัน ?');" /></td>
 			<td align="center" ><html:button  value="ยกเลิกการแก้ไข พ.1" property="cancelEdit" 
 			onclick="refreshForm()"  /></td> 			
 			<td align="center" ><html:button  value="กลับไปหาดูรายการบันทึก พ.1" property="show1" 
 			onclick="gotoStkIssue2Show()"  /></td>
 		</tr>
 	</table>    	    	    	
    </html:form><br>
    </div>

<script type="text/javascript">
function refreshForm() {
	var lAddr = document.getElementById("localAddr").value;
	var lPort = document.getElementById("localPort").value;
	var ctPath = document.getElementById("contextPath").value;
	var docNo = document.getElementById("docNo").value
	window.location = "http://"+lAddr+":"+lPort+ctPath+"/StkReq.do?mode=edit&docNo="+docNo;	
}
function gotoStkIssue2Show() {
	var lAddr = document.getElementById("localAddr").value;
	var lPort = document.getElementById("localPort").value;
	var ctPath = document.getElementById("contextPath").value;
	window.location = "http://"+lAddr+":"+lPort+ctPath+"/StkReq.do?mode=show";
}
</script>


<input type="hidden" value="<%=request.getLocalAddr() %>" id="localAddr">
<input type="hidden" value="<%=request.getLocalPort() %>" id="localPort">
<input type="hidden" value="<%=request.getContextPath() %>" id="contextPath">


<!-- 
<a href="#" class="add"><img src="add.png" width="24" height="24" alt="add" title="add input" /></a> 
<a href="#" class="reset"><img src="reset.png" width="24" height="24" alt="reset" /></a>
 -->

        
</body>
</html:html>
